package org.jeecg.modules.online.desform.test;

import com.alibaba.druid.filter.config.ConfigTools;
import org.jeecg.TristoneSystemApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @description:
 * @author: dw
 * @time: 2021/7/14 14:19
 */
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = TristoneSystemApplication.class)
public class DruidDemo {

    @Test
    public  void testDecrypt() throws Exception {
        //解密
        String word="jDUOrd8diPHZpEMd1eXuy3MWnQJFX7zsKhCWQC+j1HqONKiugt5qKOz15rxMy8WVRD/IY4yvd8rdIGHovABtmw==";
        String decryptword = ConfigTools.decrypt(word);
        System.out.println(decryptword);
    }



//    java -cp druid-1.1.22.jar com.alibaba.druid.filter.config.ConfigTools 123456pwd >aaa.txt


    @Test
    public void testEncrypt() throws Exception {
        //加密
        String password ="mom";
        String encryptword = ConfigTools.encrypt(password);
        System.out.println(encryptword);
    }
}
